package com.talent.jiwen_teacher.http.api;

import com.talent.jiwen_teacher.http.common.HttpResult;
import com.talent.jiwen_teacher.http.result.AliAuthSignResult;
import com.talent.jiwen_teacher.http.result.AliPayBindInfo;
import com.talent.jiwen_teacher.http.result.AliPayBindStatus;
import com.talent.jiwen_teacher.http.result.AppealListResult;
import com.talent.jiwen_teacher.http.result.CreateRoomBean;
import com.talent.jiwen_teacher.http.result.DiscreditListResult;
import com.talent.jiwen_teacher.http.result.ErrorListBean;
import com.talent.jiwen_teacher.http.result.EvaluateListResult;
import com.talent.jiwen_teacher.http.result.FinanceResult;
import com.talent.jiwen_teacher.http.result.HomePageResult;
import com.talent.jiwen_teacher.http.result.LoginResult;
import com.talent.jiwen_teacher.http.result.MailInfoResult;
import com.talent.jiwen_teacher.http.result.NotifyMessageResult;
import com.talent.jiwen_teacher.http.result.OrderDetailResult;
import com.talent.jiwen_teacher.http.result.OrderFinishBean;
import com.talent.jiwen_teacher.http.result.OrderListResult;
import com.talent.jiwen_teacher.http.result.OrderResult;
import com.talent.jiwen_teacher.http.result.PriceResult;
import com.talent.jiwen_teacher.http.result.SelfIntroductionResult;
import com.talent.jiwen_teacher.http.result.SmsResult;
import com.talent.jiwen_teacher.http.result.StartPracticeBean;
import com.talent.jiwen_teacher.http.result.TeacherAuthResult;
import com.talent.jiwen_teacher.http.result.TeacherInfoResult;
import com.talent.jiwen_teacher.http.result.TeacherRegsterBean;
import com.talent.jiwen_teacher.http.result.UpDataBean;
import com.talent.jiwen_teacher.http.result.VideoResult;

import java.util.Map;

import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.Header;
import retrofit2.http.POST;
import rx.Observable;

/**
 * 创建接口
 * 说明：定义了一个方法getTop250,使用get请求方式，
 * 加上@GET 标签，标签后面是这个接口的 尾址top250,完整的地址应该是 baseUrl+尾址 ，
 * 参数 使用@Query标签，如果参数多的话可以用@QueryMap标签，接收一个Map
 */

public interface EducationApi {

    /**
     * 注册
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("open/teacherCustomer/teacherRegister")
    Observable<HttpResult<TeacherRegsterBean>> teacherRegister(@FieldMap Map<String, String> map);


    /**
     * 登录
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("open/teacherCustomer/teacherLogin")
    Observable<HttpResult<LoginResult>> teacherLogin(@FieldMap Map<String, String> map);

    /**
     * 获取短信验证码
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("open/sms/send")
    Observable<HttpResult<SmsResult>> sendMsg(@FieldMap Map<String, String> map);

    /**
     * 重置密码
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("open/teacherCustomer/resetPassword")
    Observable<HttpResult<Void>> resetPassword(@FieldMap Map<String, String> map);

    /**
     * 创建聊天室
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/teacherWork/createChatRoom")
    Observable<HttpResult<CreateRoomBean>> createChatRoom(@Header("Authorization") String token, @FieldMap Map<String, String> map);


    /**
     * @author cmw
     * @description 版本更新
     */
    @FormUrlEncoded
    @POST("common/highestVersion")
    Observable<HttpResult<UpDataBean>> upDataApp(@Header("Authorization") String token, @Field("application_type") int application_type);

    /**
     * 教师注册II（教师认证）
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("open/teacherCustomer/teacherAuthentication")
    Observable<HttpResult<Void>> teacherAuthentication(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**我的——获取教师首页信息
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/teacherWork/getHomePageInfo")
    Observable<HttpResult<HomePageResult>> getHomePageInfo(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**
     * 获取订单列表
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/teacherWork/getOrderList")
    Observable<HttpResult<OrderListResult>> getOrderList(@Header("Authorization") String token, @FieldMap Map<String, String> map);


    /**
     * 获取教师待上课程
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/teacherWork/getAcceptedCourseList")
    Observable<HttpResult<OrderListResult>> getAcceptedCourseList(@Header("Authorization") String token, @FieldMap Map<String, String> map);


    /**
     *获取教师申请的订单列表
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/teacherWork/getTeacherApplyOrderList")
    Observable<HttpResult<OrderListResult>> getTeacherApplyOrderList(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**
     * 教师抢单
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/teacherWork/saveApplyInfo")
    Observable<HttpResult<Void>> saveApplyInfo(@Header("Authorization") String token, @FieldMap Map<String, String> map);


    /**
     * 教师开始上课
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/teacherWork/teacherStartClass")
    Observable<HttpResult<OrderResult>> teacherStartClass(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**
     * 教师结束上课
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/teacherWork/teacherFinishClass")
    Observable<HttpResult<Void>> teacherFinishClass(@Header("Authorization") String token, @FieldMap Map<String, String> map);


    /**
     * 教师获取订单列表
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/teacherWork/getCompletedOrderList")
    Observable<HttpResult<OrderFinishBean>> getCompletedOrderList(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**获取已结束订单的订单详情
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/teacherWork/getCompletedOrderDetailInfo")
    Observable<HttpResult<OrderDetailResult>> getCompletedOrderDetailInfo(@Header("Authorization") String token, @FieldMap Map<String, String> map);


    /**保存申诉信息
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/teacherWork/saveAppealInfo")
    Observable<HttpResult<Void>> saveAppealInfo(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**我的——获取申诉列表
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/teacherWork/getAppealList")
    Observable<HttpResult<AppealListResult>> getAppealList(@Header("Authorization") String token, @FieldMap Map<String, String> map);
    /**
     *获取教师认证信息
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/teacherWork/getTeacherAuthInfo")
    Observable<HttpResult<TeacherAuthResult>> getTeacherAuthInfo(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**
     *
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/teacherWork/teacherAuthentication")
    Observable<HttpResult<Void>> teacherAuthenticationAgin(@Header("Authorization") String token, @FieldMap Map<String, String> map);


    /**
     *获取通知消息列表
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/teacherWork/getNotifyMessageList")
    Observable<HttpResult<NotifyMessageResult>> getNotifyMessageList(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**
     *教师取消订单（只能取消尚未被学生确认的订单）
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/teacherWork/teacherCancelOrder")
    Observable<HttpResult<Void>> teacherCancelOrder(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**
     *获取教师'我的'界面——信息
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/teacherWork/getTeacherSelfInfo")
    Observable<HttpResult<TeacherInfoResult>> getTeacherSelfInfo(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**
     *获取教师'我的'界面——信息
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/teacherWork/getSelfIntroduction")
    Observable<HttpResult<SelfIntroductionResult>> getSelfIntroduction(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**获取教师失信列表
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/teacherWork/getDiscreditList")
    Observable<HttpResult<DiscreditListResult>> getDiscreditList(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**
     *我的——保存教师反馈消息
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/teacherWork/saveUserFeedBackInfo")
    Observable<HttpResult<Void>> saveUserFeedBackInfo(@Header("Authorization") String token, @FieldMap Map<String, String> map);



    /**
     *我的——更新教师上课时间
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/teacherWork/updateTeacherWorkTime")
    Observable<HttpResult<Void>> updateTeacherWorkTime(@Header("Authorization") String token, @FieldMap Map<String, String> map);


    /**
     *教师保存对学生的评分
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/teacherWork/saveTeacherScoreInfo")
    Observable<HttpResult<Void>> saveTeacherScoreInfo(@Header("Authorization") String token, @FieldMap Map<String, String> map);


    /**
     *我的——教师更新自我介绍
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/teacherWork/uploadSelfIntroduction")
    Observable<HttpResult<VideoResult>> uploadSelfIntroduction(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**我的——教师获取已评价/已回复的订单列表
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/teacherWork/getEvaluatedOrderList")
    Observable<HttpResult<EvaluateListResult>> getEvaluatedOrderList(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**
     *我的——获取alipay的签名
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/teacherWork/getAliPaySign")
    Observable<HttpResult<AliAuthSignResult>> getAliPaySign(@Header("Authorization") String token, @FieldMap Map<String, String> map);


    /**我的——获取教师的资金流
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/teacherWork/getFinanceChangeLog")
    Observable<HttpResult<FinanceResult>> getFinanceChangeLog(@Header("Authorization") String token, @FieldMap Map<String, String> map);


    /**我的——获取用户支付宝绑定状态
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/teacherWork/getAliPayBindStatus")
    Observable<HttpResult<AliPayBindStatus>> getAliPayBindStatus(@Header("Authorization") String token, @FieldMap Map<String, String> map);


    /**我的——用户绑定支付宝
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/teacherWork/updateAliPayBindInfo")
    Observable<HttpResult<AliPayBindInfo>> updateAliPayBindInfo(@Header("Authorization") String token, @FieldMap Map<String, String> map);


    /**我的——教师提现
     *
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/teacherWork/userWithdraw")
    Observable<HttpResult<Void>> userWithdraw(@Header("Authorization") String token, @FieldMap Map<String, String> map);

    /**我的——保存寄件信息
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/teacherWork/saveMailInfo")
    Observable<HttpResult<Void>> saveMailInfo(@Header("Authorization") String token, @FieldMap Map<String, String> map);


    /**我的——获取教师寄件信息
     * @param token
     * @return
     */
    @POST("customer/teacherWork/getTeacherMailInfo")
    Observable<HttpResult<MailInfoResult>> getTeacherMailInfo(@Header("Authorization") String token);


    /**教师申请课时补贴
     * @param token
     * @return
     */
    @POST("customer/teacherWork/teacherApplyDoubleReward")
    Observable<HttpResult<Void>> teacherApplyDoubleReward(@Header("Authorization") String token);


    /**我的——更新教师收费
     * @param token
     * @param map
     * @return
     */
    @FormUrlEncoded
    @POST("customer/teacherWork/teacherUpdateCharge")
    Observable<HttpResult<Void>> teacherUpdateCharge(@Header("Authorization") String token, @FieldMap Map<String, String> map);


    /**我的——获取每分钟的价格
     * @param token
     * @return
     */
    @POST("customer/teacherWork/getTeacherPrice")
    Observable<HttpResult<PriceResult>> getTeacherPrice(@Header("Authorization") String token);



    //获取错题列表
    @FormUrlEncoded
    @POST("studentWork/getStudentWrongHomeworkList")
    Observable<HttpResult<ErrorListBean>> getStudentWrongHomeworkList(@Header("Authorization") String token, @FieldMap Map<String, String> map);


    //开始题库练习
    @FormUrlEncoded
    @POST("studentWork/studentStartHomeworkPractice")
    Observable<HttpResult<StartPracticeBean>> studentStartHomeworkPractice(@Header("Authorization") String token, @FieldMap Map<String, String> map);

}

